// app.js
import './utils/utils'
import './utils/http'

App({
  globalData: {},
  token: '',
  refreshToken: '',
  onLaunch () {
    this.getToken('token')
    this.getToken('refreshToken')
  },
  // 获取token
  getToken (name) {
    // console.log(name)
    this[name] = wx.getStorageSync(name)
    // console.log(this.refreshToken)
  },
  // 保存token
  setToken (name, token) {
    this[name] = token
    // wx.setStorageSync('key', 'value')
    wx.setStorageSync(name, token)
  }
})
